package com.hotai.controller;

import com.hotai.comment.dtos.ResponseResult;
import com.hotai.comment.pojo.Ban;
import com.hotai.service.SheGenService;
import com.hotai.vo.ban.BanPage;
import com.hotai.vo.ban.BanPian;
import com.hotai.vo.ban.BanSave;
import com.hotai.vo.ban.BanXuan;
import com.hotai.vo.tupian.Pian;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sheGen")
public class SheGenController {
    @Autowired
    private SheGenService sheGenService;

    //跟新
    @RequestMapping("/xin")
    public ResponseResult Xin(@Param("name")  String name) {
        return    sheGenService.genxin(name);
    }
    //添加 修改
    @RequestMapping("/save")
    public ResponseResult Save(@RequestBody BanSave banSave) {
        return    sheGenService.saveban(banSave);
    }

    //选择
//    @RequestMapping("/")
//    public  ResponseResult  Save(){
//        return  sheGenService. ;
//    }

    //所有版本
    @RequestMapping("/choice")
    public ResponseResult  xuanze(@Param("id") Integer id){
        return  sheGenService.xuan(id);
    }

    //列表
    @RequestMapping("/list")
    public ResponseResult Banlist(BanPage banPage) {
        return    sheGenService.pageList(banPage);
    }
    //回显
    @RequestMapping("/findById")
    public ResponseResult  findBy(@Param("id") Integer id) {
        return    sheGenService.findById(id);
    }

}
